package com.jiang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jiang.controller
 * @Description:
 * @Date 2022/6/8 23:05
 */
@Controller
@RequestMapping("captcha")
public class CodeController {

    @RequestMapping("/test9")
    public String test9(){
        return "code";
    }
    @RequestMapping("test1")
    public String test(String captcha, HttpServletRequest request){
        //获取域中的验证码类
        String captcha1 =(String)request.getSession().getAttribute("captcha");
        if (captcha.equalsIgnoreCase(captcha1)){
            System.out.println("正确");
        }else {
            System.out.println("失败");
        }

        return "hello";
    }
}
